package cn.bugstack.trigger.job;

import cn.bugstack.domain.trade.service.ITradeSettlementOrderService;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author: 代码的路
 * @Date: 2025/3/5 16:15
 * @Param:
 * @Return:
 * @Description:
 **/
@Slf4j
@Service
public class GroupBuyNotifyJob {

    @Resource
    private ITradeSettlementOrderService tradeSettlementOrderService;

    @Scheduled(cron = "0 /15 * * * *")
    public void exec(){
        try{
            Map<String, Integer> result = tradeSettlementOrderService.executeSettlementNotifyJob();
            log.info("定时任务,回调通知拼团完结任务 result:{}", JSON.toJSONString(result));
        }catch (Exception e){
            log.error("定时任务,回调通知拼团完结任务失败");
        }
    }
}
